<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //   setTimeout(function(){
        //       console.log('hello world')
        //   },1000)

        new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve('hello world')
                // reject('err msg')
               
            })
           
           
        }).then((data) => {
            console.log(data)
          return new Promise((resolve,reject)=>{
              resolve(data+'aaa')
          })
        }).then(data=>{
            console.log(data)
            return new Promise(resolve=>{
                resolve(data+'bbb')
            }) 
        }).then(data=>{
            console.log(data)
            return Promise.resolve(data+'ccc')
        }).then(data=>{
            console.log(data)
            return data+'ddd'
        }).then(data=>{
            console.log(data)
        })
    </script>
</body>

</html>